import request from '@/utils/request'


// 查询采集任务列表
export function listCollection(query) {
  return request({
    url: '/collections',
    method: 'get',
    params: query
  })
}

// 查询采集任务详细
export function getCollection(collectionId) {
  return request({
    url: '/collections/' + collectionId,
    method: 'get'
  })
}

// 新增采集任务
export function addCollection(data) {
  return request({
    url: '/collections',
    method: 'post',
    data: data
  })
}

// 修改采集任务 
export function updateCollection(data) {
  return request({
    url: '/collections',
    method: 'put',
    data: data
  })
}

// 删除采集任务
export function delCollection(collectionId) {
  return request({
    url: '/collections/' + collectionId,
    method: 'delete'
  })
}

// 启动采集任务
export function startCollection(collectionId) {
  return request({
    url: '/collections/start/' + collectionId,
    method: 'get'
  })
}

// 暂停采集任务
export function stopCollection(collectionId) {
  return request({
    url: '/collections/stop/' + collectionId,
    method: 'get'
  })
}



